﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnthStat.WPF.Presentation.Controls
{
    /// <summary>
    /// Interaction logic for CsvExporter.xaml
    /// </summary>
    public partial class CsvExporter : UserControl
    {
        public CsvExporter()
        {
            InitializeComponent();
        }

        private void btnBrowse_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.SaveFileDialog openFileDialog = new System.Windows.Forms.SaveFileDialog();
            openFileDialog.AutoUpgradeEnabled = true;
            openFileDialog.OverwritePrompt = true;
            openFileDialog.DefaultExt = "csv";
            openFileDialog.Filter = "Comma Separated Values File (*.csv)|*.csv";

            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

            System.Windows.Forms.DialogResult result = openFileDialog.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                tboxFileName.Text = openFileDialog.FileName;
            }
        }
    }
}
